//
//  WmcButtonEx.swift
//  YPWatermarkCamera
//
//  Created by 赵新 on 2022/4/1.
//

import Foundation
import UIKit

extension UIButton {
    static func Wmc_themeColorBtn(color: UIColor, title: String) -> UIButton {
        return Wmc_backgroundColorBtn(backgroundColor: color, textColor: .white, title: title)
    }

    static func Wmc_whiteColorBtn(color: UIColor, title: String) -> UIButton {
        return Wmc_backgroundColorBtn(backgroundColor: .white, textColor: color, title: title)
    }

    static func Wmc_textColorBtn(color: UIColor, title: String) -> UIButton {
        return Wmc_backgroundColorBtn(backgroundColor: .clear, textColor: color, title: title)
    }

    static func Wmc_backgroundColorBtn(backgroundColor: UIColor, textColor: UIColor, title: String) -> UIButton {
        let btn = UIButton()
        btn.setTitle(title, for: .normal)
        btn.setTitleColor(textColor, for: .normal)
        btn.backgroundColor = backgroundColor
        btn.titleLabel?.font = 16.yp.uiFont(weight: .bold)
        btn.layer.cornerRadius = 4
        btn.layer.masksToBounds = true
        return btn
    }
}
